<style type="text/css">
.ui.modal .ui.form .field>.selection.dropdown{width:600px; float: left; padding: 0.3em 0.5em; }
</style>
<!--内容区开始-->
<div class="cont">
    <div class="position"><img alt="位置图标" src="dist/images/position.png" />企业号&gt;栏目管理<a ng-click="openDetail('',index_key)" ng-hide="$needClientCache" title="打开新窗口查看"><i class="large External icon"></i></a></div>
    
    <div class="mybackground">
        <div class="cont_fr_top">
            <!-- 查询条件开始 -->
            <div class="menus" >
                <div class="menus_con ui form" ng-keyup="$event.keyCode == 13 && QyAppList()">
                    <div class="four fields">
                        <div class="inline field">
                            <label>栏目名称</label>
                            <input type="text" ng-Model="search.app_name" placeholder="栏目名称" maxlength="15" style="width: 160px; ">
                        </div>
                        <div class="inline field ">
                            <label>归属企业号</label>
                            <select name='product' ng-model="search.qy_name" style="width: 170px;height:32px; padding: .3em 1em;">
                                <option value="{{x.qy_code}}" ng-repeat="x in yqList" ng-selected="search.qy_name == x.qy_code" ng-if="search.qy_name !='' ">{{x.qy_name }}</option>
                            </select>
                        </div>
                        <div class="inline field">
                            <label>栏目管理员</label>
                             <input type="text" ng-Model="search.app_admin" placeholder="栏目管理员" style="width: 160px">
                        </div>
                    </div>
                    <div class=" fields">
                        <div class="inline field">
                            <button class="clear_btn" ng-click="QyAppList()" style="margin-left: 4.5em"> 查找</button>
                        </div>
                    </div>
                </div>
            </div>
            <!-- //查询条件结束 -->
        </div>
        <!-- 列表业数据开始 -->
        <div class="menus_table">
            <table class="ui celled yellow striped table">
                 <thead>
                    <tr>
                        <th>栏目名称</th>
                        <th>栏目ID</th>
                        <th>栏目介绍</th>
                        <th>归属企业号</th>
                        <th>栏目管理员</th>
                        <th style="text-align:center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="vlist in qy_app_list " ng-show="listData">
                            <td>{{vlist.qy_app_name}}</td>
                            <td>{{vlist.qy_app_id}}</td>
                            <td>{{vlist.qy_app_description}}</td>
                            <td>{{vlist.qy_name}}</td>
                            <td>{{vlist.app_admin}}</td>
                            <td style="text-align:center">
                                <a ng-click="viewDetails(vlist.qy_app_id)" style="width:20px;height:20px">查看</a>
                                <a ng-click="addAdmin(vlist.qy_app_id)" style="width:20px;height:20px">设置管理员</a>
                                <a ng-click="addPackage(vlist.qy_code,vlist.qy_app_id)" style="width:20px;height:20px">设置套餐</a>
                            </td>
                        </tr>
                        <tr ng-show="listEmpty">
                            <td colspan="5" style="text-align:center;color:red;">没有找到数据~~~</td>
                        </tr>
                    </tbody>
            </table>
            <div class="ui pagination menu" jspagination  ng-if="QyAppPage.pageAll>1" page-object="QyAppPage" page-func="QyAppList" ></div>
        </div>
        <!-- //列表业数据结束 -->
    </div>
</div>
<!--内容区结束-->

<!--栏目详情开始-->
<div class="ui small view_details modal">
  <i class="close icon"></i>
  <div class="header_h4"> 栏目详情 </div>
  <div class="content">
   <div class="ui form">
    <form style="margin-top:10px">
        <div class="two fields">
            <div class="field">
                <b style="vertical-align: middle;">logo：</b>
                <span>
                    <img src="{{details.qy_app_logo}}" style="width: 40px; vertical-align: middle; background: #e43536; border-radius: 50%;height:40px">
                </span>
            </div>
        </div>
        <div class="two fields">
            <div class="field">
                <b>名称：</b>
                <span>{{details.qy_app_name}}</span>
            </div>
        </div>
        <div class="fields">
            <div class="field">
                <b>ID：</b>
                <span style="margin-left: 1em">{{details.qy_app_id}}</span>
            </div>
        </div>
        <div class="fields">
            <div class="field">
                <b>介绍：</b>
                <span>{{details.qy_app_description}}</span>
            </div>
        </div>
     
        <div class="fields">
            <div class="inline field">
                <div class="fl"><b>关联套餐：</b></div>
                <div class="fl">
                    <div ng-repeat="v in package_data">{{v.name}} ( {{v.product_name}} )</div>
                </div>
            </div>
        </div>
        <div class="fields">
            <div class="inline field">
                <div class="fl"><b>栏目管理员：</b></div>
                <div class="fl">
                    <div>{{details.app_admin}}</div>
                </div>
            </div>
        </div>
      </form>
    </div>
  </div> 
   <div class="actions">
    <button class="ui positive button "> 确 认 </button> 
  </di>
</div>
<!--栏目详情结束-->

<!--添加栏目开始-->
<!-- <div class="ui small add modal">
  <i class="close icon"></i>
  <div class="header_h4"> 栏目添加 </div>
  <div class="content">
   <div class="ui form">
    <form class="form" name="frm-add" id="frm-add">
        <div class="two fields">
            <div class="field">
                <label class="label_fl">企业号栏目</label>
                 <select name='qy_app_name' ng-model="add.qy_app_name" class="ui dropdown" >
                    <option value="">请选择栏目</option>
                    <option ng-repeat="x in qy_app" value="{{x.qy_app_id}}">{{x.qy_app_name}}</option>
                </select> 
            </div>
            <div class="field">
                <label class="label_fl">归属企业号</label>
                <select name='qy_name' ng-model="add.qy_name" class="ui dropdown"  style="width:180px">
                    <option value="">请选择企业号</option>
                    <option ng-repeat="x in yqList" value="{{x.qy_code}}">{{x.qy_name}}</option>
                </select> 
            </div>
        </div>
      </form>
    </div>
  </div> 
   <div class="actions" style="text-align: center;">
    <button class="ui positive button "> 确 认 </button> 
    <button class="ui grey button negative">取消</button>
  </di>
</div> -->
<!--栏目添加结束-->

<!--设置管理员开始-->
<div class="ui small add_admin modal">
  <i class="close icon"></i>
  <div class="header_h4"> 设置管理员 </div>
    <div class="content">
        <from class="ui form" id="frm-admin" name="frm-admin">
            <input type="hidden" name="app_id" id="hideAppId" value="">
            <div class="fields">
                <div class="field" >
                    <label class="label_fl" style="line-height: 44px;">栏目管理员</label>
                    <select class="ui fluid search dropdown" id="add_admin" name="add_admin_name" multiple="">
                      <!-- <option default value="">请输入栏目管理员姓名(首字符模糊查询)</option> -->
                      <option value="{{vo.user_id}}" ng-repeat="vo in sales">{{vo.nickname}} ( {{vo.role_name}} , {{vo.sector_name}} )</option>
                    </select>
                </div>
            </div>
        </from>
    </div> 
   <div class="actions" style="text-align: center;">
    <button class="ui positive button "> 确 认 </button> 
    <button class="ui grey button negative">取消</button>
  </di>
</div>
<!--设置管理员结束-->

<!--设置套餐开始-->
<div class="ui small package modal" >
  <i class="close icon"></i>
  <div class="header_h4"> 设置套餐 </div>
    <div class="content">
        <form class="ui form" name="frm-package" id="frm-package">
            <div class="fields">
                <div class="field">
                    <label class="label_fl" style="line-height: 44px;">套餐</label>
                    <select class="ui fluid search dropdown" id="packages" name="packages"  multiple="">
                      <!-- <option default value="">请输入套餐名称(首字符模糊查询)</option> -->
                      <option value="{{v.package_code}}" ng-repeat="v in productList">{{v.name}} ( {{v.product_name}} )</option>
                    </select>
                </div>
            </div>
        </form>
    </div> 
   <div class="actions" style="text-align: center;">
    <button class="ui positive button "> 确 认 </button> 
    <button class="ui grey button negative">取消</button>
  </di>
</div>
<!--设置套餐结束-->

<!--操作成功弹窗-->
<div class="ui small modal modal2 time" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge green check circle outline icon"></i>
        <p style="padding-top: 15px;">{{Msg}}</p>
    </div>
</div>
<!--操作失败弹窗-->
<div class="ui modal modal3 time" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content"> 
        <i class="huge red warning  outline icon "></i>
        <p style="padding-top: 15px;">{{Msg}} </p>
    </div>
</div>

<script type="text/javascript">
    $('.ui.dropdown').dropdown();
    $('#frm-add').form({
        on: 'blur',
        inline: true,
        fields: {
            qy_app_name: {
                identifier: 'qy_app_name',
                rules: [{
                    type: 'empty',
                    prompt: '栏目名称不能为空!!!'
                }]
            },
            qy_name: {
                identifier: 'qy_name',
                rules: [{
                    type: 'empty',
                    prompt: '归属企业号不能为空!!!'
                }]
            }
        }
    });
    $('#frm-admin .ui.dropdown').dropdown({
        message: {
          noResults  : '请输入栏目管理员名称(首字符模糊查询)'
        }

    });
    $('#frm-admin').form({
        on: 'blur',
        inline: true,
        fields: {
            add_admin_name: {
                identifier: 'add_admin_name',
                rules: [{
                    type: 'empty',
                    prompt: '栏目管理员不能为空!!!'
                }]
            },
        }
    });
    $('#frm-package .ui.dropdown').dropdown({
        message: {
          noResults  : '请输入套餐名称(首字符模糊查询)'
        }

    });
    $('#frm-package').form({
        on: 'blur',
        inline: true,
        fields: {
            packages: {
                identifier: 'packages',
                rules: [{
                    type: 'empty',
                    prompt: '套餐名称不能为空!!!'
                }]
            },
        }
    });
</script>